<? if(!defined('IN_TIPASK')) exit('Access Denied'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"><? $user=$this->user; $setting=$this->setting; ?><html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Tipask's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=TIPASK_CHARSET?>">
<link media="all" type="text/css" href="css/common/admin/admincp.css" rel="stylesheet" />
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jqueryui.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#list").sortable({
update: function(){
var reorderid="";
var numValue=$("input[name='order[]']");
for(var i=0;i<numValue.length;i++){
reorderid+=$(numValue[i]).val()+",";
}
var hiddencid=$("input[name='hiddencid']").val();
$.post("index.php?admin_link/reorder<?=$setting['seo_suffix']?>",{order:reorderid,hiddencid:hiddencid});
}
});
});

function remove(lid){
if(confirm('删除该链接，确定继续?')){
window.location="index.php?admin_link/remove/"+lid+"<?=$setting['seo_suffix']?>";;
}
}
</script>
</head>
<body>
<div class="container"><? if(isset($message)) { $type=isset($type)?$type:'correctmsg';  ?><div class="<?=$type?>"><p><?=$message?></p></div><? } ?><h3>链接列表 <a href="index.php?admin_link/add<?=$setting['seo_suffix']?>" class="sgbtn">添加链接</a> </h3>
<div class="mainbox">
<div class="note fixwidthdec">
<p class="i">链接的排序可以通过鼠标拖动来改变，当鼠标在某一链接上面时，按住左键即可上下移动。</p>
</div>
<div class="mainbox">
<table width="80%" cellspacing="0" cellpadding="3" class="list">
<tr align="center" class="list_title">
<th width="20%"><strong>链接名称</strong></th>
<th  width="25%"><strong>logo</strong></th>
<th  width="30%"><strong>描述</strong></th>
<th  width="15%"><strong>编辑</strong></th>
<th  width="10%"><strong>删除</strong></th>

</tr>    
</table>
    <input type="hidden" name="hiddencid" value="<?=$pid?>" />
<ul id="list" style="cursor: hand; cursor: pointer;" >
<? if(is_array($linklist)) { foreach($linklist as $link) { ?>
<li style="list-style:none;">
<table width="80%"  class="list" >
<tr style="background:#f7f7f7">
<td width="20%" ><input name="order[]" type="hidden" value="<?=$link['id']?>"/><a href="<?=$link['url']?>" target="_blank"><?=$link['name']?></a></td>
<td width="25%" align="center"><? if($link['logo']) { ?><img src="<?=$link['logo']?>" height="30" width="60"/><? } else { ?>无<? } ?></td>
<td width="30%" align="center"><?=$link['description']?></td>
<td width="15%" align="center"><a href="index.php?admin_link/edit/<?=$link['id']?><?=$setting['seo_suffix']?>"><img src="css/default/admin/edit.png"></a></td>
<td width="10%" align="center"><a href="javascript:remove(<?=$link['id']?>)"><img src="css/default/admin/remove.png"></a></td>
</tr>
</table>
</li>
<? } } ?>
</ul>
</div>
</div>

</body>

</html>
